// web/src/app/api/users/[id]/route.ts

import {NextRequest} from "next/server";
import {db} from "@/lib/db";

export async function GET(req: NextRequest) {
    let url = req.url
    let id = (url.slice(
        url.lastIndexOf('/') + 1
    ))

    let user = db.user.findUnique({
        where: {
            id
        }
    })

    return Response.json({user})
}